home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
016a
/
nask16.zip
/
NASK.DOC
< prev
next >
Wrap
Text File
|
1991-10-30
|
4KB
|
104 lines
N-ASK Batch Util (c) 1990 Sean Wachob -1-
___ __ ___ ________ __ ___
| \ | | / _ \ / ______| | | / /
| \ | | __ / / \ \ ( (_____ | |/ /
| |\ \| | |__| | |___| | \_____ \ | <
| | \ | | ___ | ______) ) | |\ \
|__| \___| |__| |__| |________/ |__| \__\
Ver 1.6
This is an interactive question asking program used in BATCH files. It
is used in the form of:
NASK "<question>",<possible responses> [-B] [-S]
[-D=<default answer>] [-?] [-A]
The question is any string of characters (including quotes inside the
delimeters). The possible responses are all the letters/numbers that may be
used to respond to the question. These are non-case senstive so you may put
them either in upper or lower case. The -B option makes the program beep when
a response is entered that is not in the possible answers. The -S option will
keep the cursor on the same line as the prompted question. The -D, for default
answer, will return the letter put after the equal sign when you hit enter at
the prompted question. The short help is availiable with the -? or when N-ASK
is run without any parameters. The -A function will return the ascii value of
the key pressed for the errorlevel. This will be demonstrated later.
You can use NASK to write batch menus such as:
ECHO OFF
ECHO [A] MYPROG.EXE
ECHO [B] BLAH.BAT
ECHO [C] WHATEVER.COM
ECHO [D] QUIT
ECHO"
NASK "Which one do you want? ",ABCD -s -b -d=A
if errorlevel 4 goto DONE
if errorlevel 3 goto THIRD
if errorlevel 2 goto SECOND
if errorlevel 1 goto FIRST
:FIRST
MYPROG.EXE
GOTO DONE
:SECOND
CALL BLAH.BAT
GOTO DONE
:THIRD
WHATEVER.COM
GOTO DONE
:DONE
This batch file will ECHO the availiable options and wait for the user
press one of the keys (A,B,C or D), will stay on the same line as the question,
and then will beep if they hit any other's besides those three keys. If they
hit return, it will use "A" as the answer because it was set to the default.
Then NASK will exit with an exit code relative to the position of the letter
in the choices string. Remember, in a batch process, errorlevel x means an
exit code of x or HIGHER! You must do the IF ERRORLEVEL in decending order
to sort out the errorlevels.
N-ASK Batch Util (c) 1990 Sean Wachob -2-
Another way to use this program is like this:
NASK "Press a Key:" -AS
This will print the "Press a Key" message and wait for any key to be
pressed. Then instead of the errorlevel returned being the position of the
answer in the list you gave before, the errorlevel value is now set to the
ascii value of the key pressed. In the case of a Function key, things are a
little different. Lets say for instance that you pressed the F7 key. The
computer returns a character 0 then a 65. BUT, 65 is the same as a capital
letter "A" so you have to watch out for these things.
Notes:
o You may put multiple commands after a single dash like this:
NASK "What is your answer: ",123 -bsd=1
o You do not really need quotes around the question unless you are
using a comma or you want spaces at the end of the question.
o If question is used without quotes, quotes may be put inside the
question as long as they are not the first or last character.
This program is ShareWare which means you may freely copy and distribute
this program. If you like this program and use it often, you should support
the ShareWare concept by sending $10 (make checks and money orders payable
to "Sean Wachob") to:
Sean Wachob
PO Box 10372
San Jose, CA 95157-1372
Comments or suggestions may be sent to this same address. Thank you for
using NASK and pleaselook for future releases.....